convert from data adapter to Ienumerable C#

93

convert from data adapter to Ienumerable C# -

But if you do want to use a data table first, you could use LINQ:

var list = dt.AsEnumerable().Select(r => new Person() { 
    Name = (string) r["Name"], 
    Age = (int) r["Age"] }
).ToList()

Comments

Submit
0 Comments